package com.qinglei.recoup.longconn.dispatch.task;

import com.qinglei.recoup.longconn.dispatch.util.RadarJsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class Task001 {

    @Autowired
    private RestTemplate restTemplate;

    @Scheduled(cron = "*/1 * * * * ?")
    public void execute() {
    /*    RadarJsonUtil.getAllTadayJson().forEach(f->{
            //restTemplate.getForEntity("")
            System.out.println(f);
        });*/
    }

    public static void main(String[] args) {
        List<String> allTadayJson = RadarJsonUtil.getAllTadayJson();
        RestTemplate restTemplate = new RestTemplate();
        RadarJsonUtil.getAllTadayJson().forEach(f->{
           ResponseEntity<String> forEntity = restTemplate.getForEntity("http://192.168.1.130:8686/slpAnls?fpath={fpath}", String.class,f);
           System.out.println(forEntity.getBody());
        });



    }
}
